<?php

namespace App\HttpController\Api\Admin;

use App\Service\Admin\PositionService;
use Swoole\Http\Status;

/**
 * 岗位管理-控制器
 * @author LZH
 * @since: 2021/08/12
 * Class Position
 */
class Position extends AdminBase
{
    /**
     * 初始化方法
     * @author LZH
     * @since: 2021/08/12
     */
    protected function init(): void
    {
        $this->service = new PositionService();
    }

    /**
     * 获取岗位列表
     */
    public function getPositionList()
    {
        $result = $this->service->getPositionList();
        if (!empty($result)) {
            return $this->respondQuery($result);
        } else {
            return $this->failServerError();
        }
    }
}
